package org.come.control;

import org.come.Frame.PalacePKJframe;
import org.come.Frame.ZhuFrame;
import org.come.action.FromServerAction;
import org.come.bean.PalacePkBean;
import org.come.until.FormsManagement;
import org.come.until.GsonUtil;

public class ReturnTipControl implements FromServerAction {

	@Override
	public void controlMessFromServer(String mes, String type) {
		// 依据协议头进行划分方法
		// String mesProcess[]=mes.split("//");
		if ("tip".equals(type)) {
			// 提示服务器返回来的信息
			ZhuFrame.getZhuJpanel().addPrompt2(mes);
		} else if ("bookofchalg".equals(type)) {

			PalacePkBean pkBean = GsonUtil.getGsonUtil().getgson().fromJson(mes, PalacePkBean.class);

			if (pkBean.getType() == 0) {
				PalacePKJframe.getPalacePKJframe().getPkJpanel().changeViewReception(pkBean);
			} else {
				PalacePKJframe.getPalacePKJframe().getPkJpanel().changeViewWinnerReception(pkBean);
			}
			FormsManagement.showForm(66);
		}
	}
}
